home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 74
/
Volume 74 My Disc - Damaged.iso
/
Games
/
super_fishing.swf
/
scripts
/
DoInitAction.as
Wrap
Text File
|
2008-08-08
|
2KB
|
54 lines
_global.api = new Object();
_global.api.highscore = new Object();
_global.api.highscore.initSession = function()
{
this.session = "";
while(this.session.length < 20)
{
this.session += this.charTable.charAt(Math.round(Math.random() * (this.charTable.length - 1)));
}
this.charTableIndex = new Array();
var i = 0;
while(i < this.charTable.length)
{
this.charTableIndex[this.charTable.charCodeAt(i)] = i;
i++;
}
};
_global.api.highscore.submit = function(pGame, pDisciple, pScore0, pScore1)
{
var s = "g=" + pGame + "&";
s += "d=" + pDisciple + "&";
s += "s0=" + pScore0 + "&";
s += "s1=" + pScore1 + "&";
s += "se=" + escape(session);
s += "&c=42";
var urlSubmit = this.urlSubmit + "?s=" + escape(this.encrypt(this.encrypt(s,this.keystring),this.keystring2));
getURL(urlSubmit,"_blank");
};
_global.api.highscore.encrypt = function(text, pKey)
{
var crypt = "";
var checkSum = 0;
var shift;
var code;
var i = 0;
while(i < text.length)
{
char = this.charTableIndex[text.charCodeAt(i)];
shift = this.charTableIndex[pKey.charCodeAt(i % pKey.length)];
code = char + shift + checkSum;
code %= this.charTable.length;
crypt += this.charTable.charAt(code);
checkSum += code;
i++;
}
checkSum %= this.charTable.length;
return crypt + "" + this.charTable.charAt(checkSum);
};
_global.api.highscore.charTable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&=.";
_global.api.highscore.keystring = "whytheheckdoyouwasteyourtimehackingthishighscorelist";
_global.api.highscore.keystring2 = "AnotherKey4You2FindOut4815jiagIOm30JK";
_global.api.highscore.urlSubmit = "http://www.neodelight.com/v4/high_enter.php";
_global.api.highscore.initSession();